package nc.vo.gl.voucherbill;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import nc.bs.framework.common.InvocationInfoProxy;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pub.ISuperVO;
import nc.vo.pub.IVOMeta;
import nc.vo.pub.SuperVO;
import nc.vo.pub.lang.UFDate;
import nc.vo.pub.lang.UFDateTime;
import nc.vo.pub.lang.UFDouble;
import nc.vo.pubapp.pattern.model.meta.entity.vo.VOMetaFactory;

public class GLVoucherVO extends SuperVO {
  private static final long serialVersionUID = 7589309594749963302L;
  
  public UFDateTime approvedate;
  
  public String approvenote;
  
  public String approver;
  
  public Integer approvestatus;
  
  public UFDate billdate;
  
  public String billno;
  
  public Integer billstatus;
  
  public UFDateTime creationtime;
  
  public VoucherDetailVO[] getDetails() {
	return details;
}

public void setDetails(VoucherDetailVO[] details) {
	this.details = details;
}

public String creator;
  
  public String def1;
  
  public String def10;
  
  public String def11;
  
  public String def12;
  
  public String def13;
  
  public String def14;
  
  public String def15;
  
  public String def16;
  
  public String def17;
  
  public String def18;
  
  public String def19;
  
  public String def2;
  
  public String def20;
  
  public String def3;
  
  public String def4;
  
  public String def5;
  
  public String def6;
  
  public String def7;
  
  public String def8;
  
  public String def9;
  
  public String explanation;
  
  public UFDateTime modifiedtime;
  
  public String modifier;
  
  public String period;
  
  public String pk_accountingbook;
  
  public String pk_billtypecode;
  
  public String pk_tradetypeid;
  
  public String pk_tradetypecode;
  
  public String pk_billtypeid;
  
  public String pk_group;
  
  public String pk_org;
  
  public String getPk_corp() {
	return pk_corp;
}

public void setPk_corp(String pk_corp) {
	this.pk_corp = pk_corp;
}

public String pk_corp;
  
  public String pk_org_v;
  
  public String pk_prepared;
  
  public String pk_setofbook;
  
  public String pk_voucher;
  
  public String pk_vouchertype;
  
  public UFDate prepareddate;
  
  public UFDouble totalcredit;
  
  public UFDouble totalcreditglobal;
  
  public UFDouble totalcreditgroup;
  
  public UFDouble totaldebit;
  
  public UFDouble totaldebitglobal;
  
  public UFDouble totaldebitgroup;
  
  public UFDateTime ts;
  
  public String year;
  
  private Object assignObj;
  
  private Integer saga_frozen = Integer.valueOf(0);
  
  private Integer saga_status = Integer.valueOf(0);
  
  private String saga_gtxid;
  
  private String saga_btxid;
  
  public String pk_exratetype2;
  
  public VoucherDetailVO[] details;
  
  public Object getAssignObj() {
    return this.assignObj;
  }
  
  public void setAssignObj(Object assignObj) {
    this.assignObj = assignObj;
  }
  
  public UFDateTime getApprovedate() {
    return this.approvedate;
  }
  
  public void setApprovedate(UFDateTime approvedate) {
    this.approvedate = approvedate;
  }
  
  public String getApprovenote() {
    return this.approvenote;
  }
  
  public void setApprovenote(String approvenote) {
    this.approvenote = approvenote;
  }
  
  public String getApprover() {
    return this.approver;
  }
  
  public void setApprover(String approver) {
    this.approver = approver;
  }
  
  public Integer getApprovestatus() {
    return this.approvestatus;
  }
  
  public void setApprovestatus(Integer approvestatus) {
    this.approvestatus = approvestatus;
  }
  
  public UFDate getBilldate() {
    return this.billdate;
  }
  
  public void setBilldate(UFDate billdate) {
    this.billdate = billdate;
  }
  
  public String getBillno() {
    return this.billno;
  }
  
  public void setBillno(String billno) {
    this.billno = billno;
  }
  
  public Integer getBillstatus() {
    return this.billstatus;
  }
  
  public void setBillstatus(Integer billstatus) {
    this.billstatus = billstatus;
  }
  
  public UFDateTime getCreationtime() {
    return this.creationtime;
  }
  
  public void setCreationtime(UFDateTime creationtime) {
    this.creationtime = creationtime;
  }
  
  public String getCreator() {
    return this.creator;
  }
  
  public void setCreator(String creator) {
    this.creator = creator;
  }
  
  public String getDef1() {
    return this.def1;
  }
  
  public void setDef1(String def1) {
    this.def1 = def1;
  }
  
  public String getDef10() {
    return this.def10;
  }
  
  public void setDef10(String def10) {
    this.def10 = def10;
  }
  
  public String getDef11() {
    return this.def11;
  }
  
  public void setDef11(String def11) {
    this.def11 = def11;
  }
  
  public String getDef12() {
    return this.def12;
  }
  
  public void setDef12(String def12) {
    this.def12 = def12;
  }
  
  public String getDef13() {
    return this.def13;
  }
  
  public void setDef13(String def13) {
    this.def13 = def13;
  }
  
  public String getDef14() {
    return this.def14;
  }
  
  public void setDef14(String def14) {
    this.def14 = def14;
  }
  
  public String getDef15() {
    return this.def15;
  }
  
  public void setDef15(String def15) {
    this.def15 = def15;
  }
  
  public String getDef16() {
    return this.def16;
  }
  
  public void setDef16(String def16) {
    this.def16 = def16;
  }
  
  public String getDef17() {
    return this.def17;
  }
  
  public void setDef17(String def17) {
    this.def17 = def17;
  }
  
  public String getDef18() {
    return this.def18;
  }
  
  public void setDef18(String def18) {
    this.def18 = def18;
  }
  
  public String getDef19() {
    return this.def19;
  }
  
  public void setDef19(String def19) {
    this.def19 = def19;
  }
  
  public String getDef2() {
    return this.def2;
  }
  
  public void setDef2(String def2) {
    this.def2 = def2;
  }
  
  public String getDef20() {
    return this.def20;
  }
  
  public void setDef20(String def20) {
    this.def20 = def20;
  }
  
  public String getDef3() {
    return this.def3;
  }
  
  public void setDef3(String def3) {
    this.def3 = def3;
  }
  
  public String getDef4() {
    return this.def4;
  }
  
  public void setDef4(String def4) {
    this.def4 = def4;
  }
  
  public String getDef5() {
    return this.def5;
  }
  
  public void setDef5(String def5) {
    this.def5 = def5;
  }
  
  public String getDef6() {
    return this.def6;
  }
  
  public void setDef6(String def6) {
    this.def6 = def6;
  }
  
  public String getDef7() {
    return this.def7;
  }
  
  public void setDef7(String def7) {
    this.def7 = def7;
  }
  
  public String getDef8() {
    return this.def8;
  }
  
  public void setDef8(String def8) {
    this.def8 = def8;
  }
  
  public String getDef9() {
    return this.def9;
  }
  
  public void setDef9(String def9) {
    this.def9 = def9;
  }
  
  public String getExplanation() {
    return this.explanation;
  }
  
  public void setExplanation(String explanation) {
    this.explanation = explanation;
  }
  
  public UFDateTime getModifiedtime() {
    return this.modifiedtime;
  }
  
  public void setModifiedtime(UFDateTime modifiedtime) {
    this.modifiedtime = modifiedtime;
  }
  
  public String getModifier() {
    return this.modifier;
  }
  
  public void setModifier(String modifier) {
    this.modifier = modifier;
  }
  
  public String getPeriod() {
    return this.period;
  }
  
  public void setPeriod(String period) {
    this.period = period;
  }
  
  public String getPk_accountingbook() {
    return this.pk_accountingbook;
  }
  
  public void setPk_accountingbook(String pk_accountingbook) {
    this.pk_accountingbook = pk_accountingbook;
  }
  
  public String getPk_billtypecode() {
    return this.pk_billtypecode;
  }
  
  public void setPk_billtypecode(String pk_billtypecode) {
    this.pk_billtypecode = pk_billtypecode;
  }
  
  public String getPk_billtypeid() {
    return this.pk_billtypeid;
  }
  
  public void setPk_billtypeid(String pk_billtypeid) {
    this.pk_billtypeid = pk_billtypeid;
  }
  
  public String getPk_group() {
    return this.pk_group;
  }
  
  public void setPk_group(String pk_group) {
    this.pk_group = pk_group;
  }
  
  public String getPk_org() {
    return this.pk_org;
  }
  
  public void setPk_org(String pk_org) {
    this.pk_org = pk_org;
  }
  
  public String getPk_org_v() {
    return this.pk_org_v;
  }
  
  public void setPk_org_v(String pk_org_v) {
    this.pk_org_v = pk_org_v;
  }
  
  public String getPk_prepared() {
    return this.pk_prepared;
  }
  
  public void setPk_prepared(String pk_prepared) {
    this.pk_prepared = pk_prepared;
  }
  
  public String getPk_setofbook() {
    return this.pk_setofbook;
  }
  
  public void setPk_setofbook(String pk_setofbook) {
    this.pk_setofbook = pk_setofbook;
  }
  
  public String getPk_voucher() {
    return this.pk_voucher;
  }
  
  public void setPk_voucher(String pk_voucher) {
    this.pk_voucher = pk_voucher;
  }
  
  public String getPk_vouchertype() {
    return this.pk_vouchertype;
  }
  
  public void setPk_vouchertype(String pk_vouchertype) {
    this.pk_vouchertype = pk_vouchertype;
  }
  
  public UFDate getPrepareddate() {
    return this.prepareddate;
  }
  
  public void setPrepareddate(UFDate prepareddate) {
    this.prepareddate = prepareddate;
  }
  
  public UFDouble getTotalcredit() {
    return this.totalcredit;
  }
  
  public void setTotalcredit(UFDouble totalcredit) {
    this.totalcredit = totalcredit;
  }
  
  public UFDouble getTotalcreditglobal() {
    return this.totalcreditglobal;
  }
  
  public void setTotalcreditglobal(UFDouble totalcreditglobal) {
    this.totalcreditglobal = totalcreditglobal;
  }
  
  public UFDouble getTotalcreditgroup() {
    return this.totalcreditgroup;
  }
  
  public void setTotalcreditgroup(UFDouble totalcreditgroup) {
    this.totalcreditgroup = totalcreditgroup;
  }
  
  public UFDouble getTotaldebit() {
    return this.totaldebit;
  }
  
  public void setTotaldebit(UFDouble totaldebit) {
    this.totaldebit = totaldebit;
  }
  
  public UFDouble getTotaldebitglobal() {
    return this.totaldebitglobal;
  }
  
  public void setTotaldebitglobal(UFDouble totaldebitglobal) {
    this.totaldebitglobal = totaldebitglobal;
  }
  
  public UFDouble getTotaldebitgroup() {
    return this.totaldebitgroup;
  }
  
  public void setTotaldebitgroup(UFDouble totaldebitgroup) {
    this.totaldebitgroup = totaldebitgroup;
  }
  
  public UFDateTime getTs() {
    return this.ts;
  }
  
  public void setTs(UFDateTime ts) {
    this.ts = ts;
  }
  
  public String getYear() {
    return this.year;
  }
  
  public void setYear(String year) {
    this.year = year;
  }
  
  public String getPk_tradetypeid() {
    return this.pk_tradetypeid;
  }
  
  public void setPk_tradetypeid(String pk_tradetypeid) {
    this.pk_tradetypeid = pk_tradetypeid;
  }
  
  public String getPk_tradetypecode() {
    return this.pk_tradetypecode;
  }
  
  public void setPk_tradetypecode(String pk_tradetypecode) {
    this.pk_tradetypecode = pk_tradetypecode;
  }
  
  public IVOMeta getMetaData() {
    return VOMetaFactory.getInstance().getVOMeta("gl.GLVoucherVO");
  }
  
  public Integer getSaga_frozen() {
    return this.saga_frozen;
  }
  
  public void setSaga_frozen(Integer saga_frozen) {
    this.saga_frozen = saga_frozen;
  }
  
  public Integer getSaga_status() {
    return this.saga_status;
  }
  
  public void setSaga_status(Integer saga_status) {
    this.saga_status = saga_status;
  }
  
  public String getSaga_gtxid() {
    return this.saga_gtxid;
  }
  
  public void setSaga_gtxid(String saga_gtxid) {
    this.saga_gtxid = saga_gtxid;
  }
  
  public String getSaga_btxid() {
    return this.saga_btxid;
  }
  
  public void setSaga_btxid(String saga_btxid) {
    this.saga_btxid = saga_btxid;
  }
  
  public String getPk_exratetype2() {
    return this.pk_exratetype2;
  }
  
  public void setPk_exratetype2(String pk_exratetype2) {
    this.pk_exratetype2 = pk_exratetype2;
  }
  
  public GLVoucherAggVO toVoucherVO() {
	    GLVoucherAggVO aggVO = new GLVoucherAggVO();
	    GLVoucherVO voucherVO = new GLVoucherVO();
	    if (!isEmptyWithTrim(this.pk_voucher))
	      voucherVO.setPk_voucher(this.pk_voucher); 
	    if (!isEmptyWithTrim(this.pk_corp))
		      voucherVO.setPk_corp(this.pk_corp);
	    if (!isEmptyWithTrim(this.pk_accountingbook))
	      voucherVO.setPk_accountingbook(this.pk_accountingbook); 
	    if (!isEmptyWithTrim(this.pk_org))
	      voucherVO.setPk_org(this.pk_org); 
	    if (!isEmptyWithTrim(this.pk_org_v))
	      voucherVO.setPk_org_v(this.pk_org_v); 
	    if (!isEmptyWithTrim(this.pk_setofbook))
	      voucherVO.setPk_setofbook(this.pk_setofbook); 
	    if (!isEmptyWithTrim(this.pk_group)) {
	      voucherVO.setPk_group(this.pk_group);
	    } else {
	      voucherVO.setPk_group(InvocationInfoProxy.getInstance().getGroupId());
	    } 
	    if (!isEmptyWithTrim(this.pk_vouchertype))
	      voucherVO.setPk_vouchertype(this.pk_vouchertype); 
	    if (!isEmptyWithTrim(this.year))
	      voucherVO.setYear(this.year); 
	    if (!isEmptyWithTrim(this.period))
	      voucherVO.setPeriod(this.period); 
	    if (!isEmptyWithTrim(this.prepareddate))
	      voucherVO.setPrepareddate(this.prepareddate); 
	    if (!isEmptyWithTrim(this.pk_prepared)) {
	      voucherVO.setPk_prepared(this.pk_prepared);
	    } else {
	      voucherVO.setPk_prepared(InvocationInfoProxy.getInstance().getUserId());
	    } 
	    if (!isEmptyWithTrim(this.totaldebit))
	      voucherVO.setTotaldebit(new UFDouble(this.totaldebit)); 
	    if (!isEmptyWithTrim(this.totalcredit))
	      voucherVO.setTotalcredit(new UFDouble(this.totalcredit)); 
	    if (!isEmptyWithTrim(this.explanation))
	      voucherVO.setExplanation(this.explanation); 
	    if (!isEmptyWithTrim(this.billdate))
	      voucherVO.setBilldate(this.billdate); 
	    if (!isEmptyWithTrim(this.billstatus))
	      voucherVO.setBillstatus(this.billstatus);
	    if (!isEmptyWithTrim(this.approvestatus))
	      voucherVO.setApprovestatus(this.approvestatus);
	    if (!isEmptyWithTrim(this.approver))
	      voucherVO.setApprover(this.approver); 
	    if (!isEmptyWithTrim(this.approvedate))
	      voucherVO.setApprovedate(this.approvedate); 
	    if (!isEmptyWithTrim(this.pk_billtypeid)) {
	      voucherVO.setPk_billtypeid(this.pk_billtypeid);
	    } else {
	      voucherVO.setPk_billtypeid("0001Z31000000003YKEV");
	    } 
	    if (!isEmptyWithTrim(this.pk_billtypecode)) {
	      voucherVO.setPk_billtypecode(this.pk_billtypecode);
	    } else {
	      voucherVO.setPk_billtypecode("VR01");
	    } 
	    if (!isEmptyWithTrim(this.pk_tradetypeid))
	      voucherVO.setPk_tradetypeid(this.pk_tradetypeid); 
	    if (!isEmptyWithTrim(this.pk_tradetypecode)) {
	      voucherVO.setPk_tradetypecode(this.pk_tradetypecode);
	    } else {
	      voucherVO.setPk_tradetypecode("VRD1");
	    } 
	    if (!isEmptyWithTrim(this.billno))
	      voucherVO.setBillno(this.billno); 
	    if (!isEmptyWithTrim(this.creator))
	      voucherVO.setCreator(this.creator); 
	    if (!isEmptyWithTrim(this.creationtime))
	      voucherVO.setCreationtime(this.creationtime); 
	    if (!isEmptyWithTrim(this.modifier))
	      voucherVO.setModifier(this.modifier); 
	    if (!isEmptyWithTrim(this.modifiedtime))
	      voucherVO.setModifiedtime(this.modifiedtime); 
	    if (!isEmptyWithTrim(this.totaldebitgroup))
	      voucherVO.setTotaldebitgroup(new UFDouble(this.totaldebitgroup)); 
	    if (!isEmptyWithTrim(this.totalcreditgroup))
	      voucherVO.setTotalcreditgroup(new UFDouble(this.totalcreditgroup)); 
	    if (!isEmptyWithTrim(this.totaldebitglobal))
	      voucherVO.setTotaldebitglobal(new UFDouble(this.totaldebitglobal)); 
	    if (!isEmptyWithTrim(this.totalcreditglobal))
	      voucherVO.setTotalcreditglobal(new UFDouble(this.totalcreditglobal)); 
	    if (!isEmptyWithTrim(this.def1))
	      voucherVO.setDef1(this.def1); 
	    if (!isEmptyWithTrim(this.def2))
	      voucherVO.setDef2(this.def2); 
	    if (!isEmptyWithTrim(this.def3))
	      voucherVO.setDef3(this.def3); 
	    if (!isEmptyWithTrim(this.def4))
	      voucherVO.setDef4(this.def4); 
	    if (!isEmptyWithTrim(this.def5))
	      voucherVO.setDef5(this.def5); 
	    if (!isEmptyWithTrim(this.def6))
	      voucherVO.setDef6(this.def6); 
	    if (!isEmptyWithTrim(this.def7))
	      voucherVO.setDef7(this.def7); 
	    if (!isEmptyWithTrim(this.def8))
	      voucherVO.setDef8(this.def8); 
	    if (!isEmptyWithTrim(this.def9))
	      voucherVO.setDef9(this.def9); 
	    if (!isEmptyWithTrim(this.def10))
	      voucherVO.setDef10(this.def10); 
	    if (!isEmptyWithTrim(this.def11))
	      voucherVO.setDef11(this.def11); 
	    if (!isEmptyWithTrim(this.def12))
	      voucherVO.setDef12(this.def12); 
	    if (!isEmptyWithTrim(this.def13))
	      voucherVO.setDef13(this.def13); 
	    if (!isEmptyWithTrim(this.def14))
	      voucherVO.setDef14(this.def14); 
	    if (!isEmptyWithTrim(this.def15))
	      voucherVO.setDef15(this.def15); 
	    if (!isEmptyWithTrim(this.def16))
	      voucherVO.setDef16(this.def16); 
	    if (!isEmptyWithTrim(this.def17))
	      voucherVO.setDef17(this.def17); 
	    if (!isEmptyWithTrim(this.def18))
	      voucherVO.setDef18(this.def18); 
	    if (!isEmptyWithTrim(this.def19))
	      voucherVO.setDef19(this.def19); 
	    if (!isEmptyWithTrim(this.def20))
	      voucherVO.setDef20(this.def20); 
	    if (!isEmptyWithTrim(this.pk_exratetype2))
	      voucherVO.setPk_exratetype2(this.pk_exratetype2); 
	    if (!isEmptyWithTrim(this.ts))
	      voucherVO.setTs(new UFDateTime()); 
	    aggVO.setParent(voucherVO);
	    if (this.details != null) {
	      List<VoucherDetailVO> detailVOs = new ArrayList<>();
            Collections.addAll(detailVOs, this.details);
	      aggVO.setChildrenVO((CircularlyAccessibleValueObject[])detailVOs.toArray((Object[])new VoucherDetailVO[0]));
	    } 
	    return aggVO;
	  }
  
  private static boolean isEmptyWithTrim(Object obj) {
	    return (obj == null );
	  }
  
}
